from django.contrib import admin

# Register your models here.
from django.apps import apps
from django.contrib import admin


def register_all_models():
    # 获取应用配置
    app_config = apps.get_app_config("manufacture_analysis")
    app_config.verbose_name = "堡垒机PMC数据库"

    # 获取应用中的所有模型
    models_list = app_config.get_models()
    print(models_list)

    # 注册所有模型
    for model in models_list:
        # 如果模型尚未注册
        if not admin.site.is_registered(model):
            admin.site.register(model)


# 调用函数注册所有模型
register_all_models()
